﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace RadioThermostat
{
    public class JSONNetDecoderv : IJSONDecoder
    {
        private static readonly JSONNetDecoderv instance;
        static JSONNetDecoderv()
        {
            instance = new JSONNetDecoderv();
        }

        public static JSONNetDecoderv Instance
        {
            get { return instance; }
        }

        public string GetJson(object jsonObject)
        {
            return JsonConvert.SerializeObject(jsonObject);
        }

        public T Deserialize<T>(string json)
        {
            return JsonConvert.DeserializeObject<T>(json);
        }

    }
}
